Ext.define('FM.controller.comprofile.ComProfileController',
		{
			extend : 'FM.controller.MainController',
			views : [ 'grid.comprofile.ComProfileGrid',
					'grid.comprofile.ComProfilePanel',
					'tree.comprofile.ComProfileTree',
					'form.comprofile.AddProfileForm' ],
			stores : [ 'FM.store.grid.comprofile.ComProfileGridStore' ],
			models : [ 'FM.model.grid.comprofile.ComProfileGridModel' ],
			refs : [ {
				ref : 'ref_comProfileTree',
				selector : 'ComProfileTree'
			}, {
				ref : 'ref_comProfileGrid',
				selector : 'ComProfileGrid'
			}, {
				ref : 'ref_addProfileForm',
				selector : 'AddProfileForm'
			} ],
			init : function() {
				console.log('The comprofile panel was rendered');
				appTab(Ext.getCmp('Center'), 'comProfilePanel', '', '公司档案',
						'comProfilePanel');
				this.control({
					'ComProfileGrid button[action=save]' : {
						click : this.showSaveProfileForm
					},
					'ref_addProfileForm button[action=save]' : {
						click : this.saveProfile
					}
				});
			},
			showSaveProfileForm : function(){
				this.showWindow('AddProfileForm', 'addProfileForm', '添加新公司');
			}
		});